<!doctype html>
<head>
        <meta name="keywords" content="羽毛球，公告，球场，教练">
		<meta name="charset" content="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/jquery.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/bootstrap.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/md5.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/jquery-form.js"></script>
	    <script></script>
</head>		
<div class="right_box">
		<div class="content content_hastab">	
			<form class='' id='' name="" action="__APP__/Home/Announce/updateAnnounce" method="post" enctype="multipart/form-data">
				<table  style="">
                <tbody>
                   <tr>
                   	   <td>
                   		   <label >公告标题</label>
                   	   </td>
                   	   <td>
                   		   <input type="text" name="announce_title" id="announce_title" maxlength="30"/><input type="hidden" name="announce_id" id="announce_id" ></input>
                   	   </td>
                   </tr>
                 

                   <tr>
                   	   <td>
                   		   <label >公告描述</label>
                   	   </td>
                   	   <td>
                   	   	<textarea id="announce_content" name="announce_content" rows="3" cols="20" maxlength="1000"></textarea>
                   	    </td>
                   </tr>
				  
                   <tr>
                   	   <td>
                   		   <label>公告类型</label>
                   	   </td>
                   	   <td>
                   		  <select name="announce_type" id="announce_type">
                                      <option value="0" disabled="disabled">系统公告</option>
                                      <option value="1"  >球馆公告</option>
									  <option value="2"  >教练公告</option>
                                      <option value="3"  >球会公告</option>
                    
                           </select>
                   	   </td>
                   </tr>
				     <tr>
                   	   <td>
                   		   <label>是否公开</label>
                   	   </td>
                   	   <td>
                   		  <select name="if_public" id="if_public">
                                      <option value="0" >不公开</option>
                                      <option value="1">公开</option>                    
                           </select>
                   	   </td>
                   </tr>
                   <tr>
                        <td>
                              <label title='公告图片' for="announce_picture">公告图片</label>
                        </td>
                        <td>                
                              <input type="file" name="announce_picture" id="announce_picture"/>
                        </td>
                   </tr>
                  </tbody> 
                </table>
                <input type="submit" />
            </form>
		</div>
	</div>	
</div>
<script type="text/javascript">
 $(function(){
        var access=parent.access;
		switch (access)
		{
		  case 0:
		  document.getElementById("announce_type").options[0].disabled=true;
		  document.getElementById("announce_type").options[1].disabled=true;
		  document.getElementById("announce_type").options[2].disabled=true;
		  document.getElementById("announce_type").options[3].disabled=true;
		  break;
		  case 1:
		  document.getElementById("announce_type").options[0].disabled=true;
		  document.getElementById("announce_type").options[1].disabled=false;
		  document.getElementById("announce_type").options[2].disabled=true;
		  document.getElementById("announce_type").options[3].disabled=true;
		  break;
		  case 2:
		  document.getElementById("announce_type").options[0].disabled=true;
		  document.getElementById("announce_type").options[1].disabled=true;
		  document.getElementById("announce_type").options[2].disabled=true;
		  document.getElementById("announce_type").options[3].disabled=false;
		  break;
		  case 3:
		  document.getElementById("announce_type").options[0].disabled=true;
		  document.getElementById("announce_type").options[1].disabled=true;
		  document.getElementById("announce_type").options[2].disabled=false;
		  document.getElementById("announce_type").options[3].disabled=true;
		  break;
		  case 4:
		  document.getElementById("announce_type").options[0].disabled=true;
		  document.getElementById("announce_type").options[1].disabled=false;
		  document.getElementById("announce_type").options[2].disabled=true;
		  document.getElementById("announce_type").options[3].disabled=false;
		  break;
		  case 5:
		  document.getElementById("announce_type").options[0].disabled=true;
		  document.getElementById("announce_type").options[1].disabled=false;
		  document.getElementById("announce_type").options[2].disabled=false;
		  document.getElementById("announce_type").options[3].disabled=true;
		  break;
		  case 6:
		  document.getElementById("announce_type").options[0].disabled=true;
		  document.getElementById("announce_type").options[1].disabled=true;
		  document.getElementById("announce_type").options[2].disabled=false;
		  document.getElementById("announce_type").options[3].disabled=false;
		  break;
		  case 7:
		  document.getElementById("announce_type").options[0].disabled=true;
		  document.getElementById("announce_type").options[1].disabled=false;
		  document.getElementById("announce_type").options[2].disabled=false;
		  document.getElementById("announce_type").options[3].disabled=false;
		  break;
		  default:
		  
		  break;
		}
		$.post('__URL__/announceDetail',{'announce_id':parent.selected},function(resultList){ 			   
			   announceJson=resultList.result;
			  document.getElementById("announce_id").value=announceJson.announce_id;
			  document.getElementById("announce_title").value=announceJson.announce_title;
			  document.getElementById("announce_content").value=announceJson.announce_content;
			  document.getElementById("announce_type").value=announceJson.announce_type;
			  document.getElementById("if_public").value=announceJson.if_public;
    	     },'json');  
			
		});
</script>